﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="UC_ProductList.ascx.cs"
    Inherits="Stationery.UC.UC_ProductList" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxDataView" TagPrefix="dxdv" %>
<%@ Register Assembly="DevExpress.Web.ASPxEditors.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxEditors" TagPrefix="dxe" %>
<%@ Register Assembly="DevExpress.Web.v9.2, Version=9.2.6.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a"
    Namespace="DevExpress.Web.ASPxPopupControl" TagPrefix="dxpc" %>
    
<table width="100%">
    <tr>
        <td>
            <table cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <td width="100%">
                        <dxe:ASPxTextBox ID="ASPxTextBox1" runat="server" Width="100%">
                        </dxe:ASPxTextBox>
                    </td>
                    <td align="right" style="padding-left: 1px;">
                        <dxe:ASPxButton ID="ASPxButtonSearch" runat="server" Text="Tìm kiếm" Wrap="False"
                            OnClick="ASPxButtonSearch_Click">
                        </dxe:ASPxButton>
                    </td>
                </tr>
            </table>
        </td>
    </tr>
    <tr>
        <td align="center">
            <dxdv:ASPxDataView ID="ASPxDataViewProduct" runat="server" AllowPaging="True" ColumnCount="3"
                EnableTheming="True" Border-BorderStyle="None" ItemSpacing="2px" RowPerPage="4">
                <EmptyDataStyle>
                    <Border BorderStyle="None" />
                </EmptyDataStyle>
                <ContentStyle>
                    <BorderTop BorderStyle="None" />
                    <BorderBottom BorderStyle="None" />
                    <Paddings Padding="0" />
                </ContentStyle>
                <Border BorderStyle="None" />
                <EmptyItemStyle>
                    <Border BorderStyle="None" />
                </EmptyItemStyle>
                <ItemStyle Width="185px">
                    <Paddings Padding="0px" />
                </ItemStyle>
                <ItemTemplate>
                    <table cellpadding="0" cellspacing="0" style="vertical-align: top; width: 100%;">
                        <tr>
                            <td valign="top" class="grpProduct_top">
                            </td>
                        </tr>
                        <tr align="center">
                            <td class="grpProduct_center">
                                <table cellpadding="0" cellspacing="0" width="100%">
                                    <tr>
                                        <td align="center">
                                            <a href='<%# GetLinkDetail(Eval("ID")) %>'>
                                                <div class="ImgProduct_div">
                                                    <asp:Image ID="ImageButton1" CssClass="ImgProduct" runat="server" ImageUrl='<%# Eval("IMAGE_DIRECTORY").ToString() %>' />
                                                </div>
                                            </a>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" style="height: 20px;" class="grpProduct_center">
                            </td>
                        </tr>
                        <tr>
                            <td valign="top" class="grpProduct_bottom" align="center">
                                <table cellspacing="0" style="margin-left: 0px; margin-top: 2px; vertical-align: text-top;
                                    width: 100%; table-layout: fixed;">
                                    <tr>
                                        <td>
                                            <table cellpadding="0" cellspacing="0" width="100%">
                                                <tr>
                                                    <td align="center" style="overflow: hidden; padding-left: 5px;" nowrap="nowrap">
                                                        <a class="lblProduct_title">
                                                            <%# Eval("NAME") %></a> <a class="StatusStock" style='color: <%# GetColorStatus(Eval("STAT_STOCK")) %>'>
                                                                <%# GetStatusStore(Eval("STAT_STOCK"))%></a>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <%--                                    <tr>
                                        <td style="height: 55px; vertical-align: text-top; overflow: hidden; width: 50px">
                                            <div style="word-wrap: break-word; width: 100%; text-align: justify; overflow: hidden;
                                                height: 55px; font-size: 8pt; color: #3F3F3F;">
                                                <%#Eval("DESCRIPTION")%></div>
                                        </td>
                                    </tr>--%>
                                    <tr>
                                        <td style="height: 100%; vertical-align: text-bottom; text-align: center;">
                                            <a class="price_color">Đơn giá:
                                                <asp:Label ID="LabelPrice" runat="server" Text='<%# Eval("PRICE","{0:### ### ###}").ToString()+ " VNĐ /" + (Convert.ToDecimal(Eval("WEIGHT"))/1000).ToString() + "kg"  %>'></asp:Label>
                                            </a>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td style="height: 100%; vertical-align: text-bottom;" align="center">
                                            <table cellpadding="1">
                                                <tr>
                                                    <td>
                                                        <%--                                                        <dxe:ASPxButton ID="ASPxButtonDetail" runat="server" CommandArgument='<%# Eval("ID") %>'
                                                            Cursor="pointer" EnableDefaultAppearance="False" EnableTheming="False" Image-Url="~/Image/Icon/chitiet.gif"
                                                            OnClick="ASPxButtonDetail_Click" ToolTip="Chi tiết">
                                                            <Image Height="22px" Url="~/Image/Icon/chitiet.gif" Width="22px" />
                                                            <Border BorderStyle="None" />
                                                        </dxe:ASPxButton>--%>
                                                        <dxe:ASPxButton ID="ASPxButton1" runat="server" CommandArgument='<%# Eval("ID") %>'
                                                            Cursor="pointer" EnableDefaultAppearance="False" EnableTheming="False" OnClick="ASPxButtonFastCart_Click"
                                                            ToolTip="Mua hàng" Visible='<%#  GetVisibleStatus(Eval("STAT_STOCK")) %>'>
                                                            <Image Url="~/Image/Button/btn_fastorder.png" />
                                                            <Border BorderStyle="None" />
                                                        </dxe:ASPxButton>
                                                    </td>
                                                    <td align="center">
                                                        <dxe:ASPxButton ID="ASPxButtonCart" runat="server" CommandArgument='<%# Eval("ID") %>'
                                                            Cursor="pointer" EnableDefaultAppearance="False" EnableTheming="False" OnClick="ASPxButtonCart_Click"
                                                            ToolTip="Giỏ hàng" Visible='<%# GetVisibleStatus(Eval("STAT_STOCK")) %>'>
                                                            <Image Url="~/Image/Button/btn_order.png" />
                                                            <Border BorderStyle="None" />
                                                        </dxe:ASPxButton>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </ItemTemplate>
                <Paddings Padding="0px" />
                <PagerSettings Position="Bottom">
                    <Summary Text="Trang {0} / {1}" />
                </PagerSettings>
            </dxdv:ASPxDataView>
        </td>
    </tr>
</table>
